package com.shop.admin.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.shop.admin.entity.Organization;
import com.shop.admin.entity.Post;
import com.shop.admin.vo.PostPageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * (Post)表数据库访问层
 *
 * @author makejava
 * @since 2023-05-18 18:45:57
 */
@Mapper
public interface PostDao extends BaseMapper<Post> {

    Page<PostPageVo> queryPostPageVoList(@Param("page") Page<PostPageVo> page, @Param("params") Map<String, Object> params);

    Page<PostPageVo> queryPostToExamineList(@Param("page")Page<PostPageVo> page,@Param("params") Map<String, Object> params);

    Page<PostPageVo> queryPostTopPageVoList(@Param("page")Page<PostPageVo> page, @Param("params")Map<String, Object> params);

    List<PostPageVo> queryPostTopVoList(@Param("params")Map<String, Object> params);

    @Update("UPDATE post SET is_top = NULL WHERE id = #{intValue}")
    void updatePostToNull(@Param("intValue") int intValue);
}

